Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(kernel: memory): switch to a higher-half kernel #7

Merged
merged 6 commits into from
Feb 19, 2024

Conversation

d4ilyrun
Copy link
Owner

@d4ilyrun d4ilyrun commented Feb 19, 2024

What ?

Virtually relocate our kernel's code into the higher-half of the address space (0xC0000000).

Why ?

This will simplify the process of including our kernel's code into userland processes later on, and make it easier to link them against our kernel.

Please refer to the related issue (#6) for detailed information.

Related issue

Resolves #6

The kernel's code is now virtually relocated at 0xC000000 by the linker.

> BREAKING !

This has been done to switch to a higher-half kernel design. In its
current state, the kernel cannot startup, as we need to temporarily
activate paging for the C startup code to be executed normally.
@d4ilyrun d4ilyrun added type: enhancement Improve an already existing feature target: kernel Kernel related features arch: none Not architecture specific labels Feb 19, 2024
@d4ilyrun d4ilyrun self-assigned this Feb 19, 2024
@d4ilyrun d4ilyrun linked an issue Feb 19, 2024 that may be closed by this pull request
@d4ilyrun
Copy link
Owner Author

d4ilyrun commented Feb 19, 2024

This looks ready to merge !

I just got one issue, i cannot seem to get GDB working after switching to higher-half. We should fix this issue before merging, this is a pain in the a** when debugging.

edit: fixed with 978dc95

Since switching to a higher-half kernel, placing the "target remote ..."
inside the gdbinit script seems to make GDB crash. Having it executed
as a CLI argument seems to be a working alternative.

This script lets us chose which symbol we want to set a breakpoint on,
instead of hardcoding it to kernel_main inside the gdbinit script.
@d4ilyrun d4ilyrun merged commit 5caa1c6 into master Feb 19, 2024
1 check passed
@d4ilyrun d4ilyrun deleted the 6-higher-half-kernel branch February 19, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch: none Not architecture specific target: kernel Kernel related features type: enhancement Improve an already existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to a higher-half kernel design
1 participant